home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / pascal / tppcx.zip / PCX.DOC < prev    next >
Text File  |  1991-01-29  |  26KB  |  562 lines

  1. PCX.TPU  -  TPv6.0 Object-Oriented unit for displaying or saving PCX format
  2.             picture files on Hercules, EGA, VGA, or compatible adapters.
  3.  
  4. ╔═════════╗
  5. ║ BasePCX ║█
  6. ╚═════════╝█
  7.   ▀▀▀▀▀▀▀▀▀▀
  8. The BasePCX object provides basic PCX functions that are independant of the
  9. adapter type. This object is used in the abstract to create device dependant
  10. objects.
  11.  
  12. RESTRICTIONS ─────────────────────────────────────────────────────────────────
  13.  
  14. This unit is for use only with EGA/ECM, VGA, and Hercules compatible devices.
  15. Extended image files, ones exceeding the displaying device resolution,
  16. cannot be read at this time and will generate a PCXError. Future versions
  17. will handle panning. When reading a file which was created by a higher
  18. resolution device than the device displaying the file, it may still be read
  19. as long as the image dimensions do not exceed the display device resolution.
  20. The image size can be set in the paint program before creating the picture if
  21. you wish to make the PCX file compatible with several devices.
  22.  
  23. FIELDS ───────────────────────────────────────────────────────────────────────
  24.  
  25. PCXError    PcxError: byte;                                       Read only
  26.  
  27.             Set to constant equivalent if an error is encountered in reading
  28.             writing from object.
  29.             See: BasePCX.GetPCXError
  30.  
  31. Loaded      Loaded: boolean;                                      Read/Write
  32.  
  33.             Set to false at object initialization, it is set to true after a
  34.             picture has been loaded. It tells internal methods that a
  35.             picture has been loaded and if the image or portion of the image
  36.             is saved as another file, the existing color mapping is written
  37.             to the new file.
  38.             See: BasePCX.PCXLoaded
  39.  
  40. Hdr         Hdr: Header;                                          Read only
  41.  
  42.             Record containing information pertaining to the picture file. The
  43.             record is filled when reading a PCX file from a 128 byte file
  44.             header that precedes the actual image data. The last 58 bytes of
  45.             the file header are just filler, so these are ignored. The header
  46.             record contains the following fields:
  47.                   Maker: integer;
  48.                         Code that specifies the picture generating program
  49.                         conforms to PCX format. PCXError set if incorrect
  50.                         maker, further methods halted.
  51.                   Version: integer;
  52.                         Code stating what PCX format version the following
  53.                         picture file was created with. PCXError set if incor-
  54.                         rect version, further methods halted.
  55.                   Encoding: integer;
  56.                         Code indicating the compression type of the following
  57.                         picture file. PCXError set if not run-length encoded,
  58.                         further methods halted.
  59.                   bpp: integer;
  60.                         Number indicating the number of bits per pixel per
  61.                         plane. Not used in this unit version.
  62.                   xmn: integer;
  63.                         Number setting the upper left horizontal coordinate
  64.                         of following picture.
  65.                         See: BasePCX.GetXmn
  66.                   ymn: integer;
  67.                         Number setting the upper left vertical coordinate of
  68.                         following picture.
  69.                         See: BasePCX.GetYmn
  70.                   xmx: integer;
  71.                         Number setting the lower right horizontal coordinate
  72.                         of following picture.
  73.                         See: BasePCX.GetXmx
  74.                   ymx: integer;
  75.                         Number setting the lower right vertical coordinate of
  76.                         following picture.
  77.                         See: BasePCX.GetYmx
  78.                   HRes: integer;
  79.                         Number indicating the horizontal resolution of the
  80.                         device that the created the picture file.
  81.                   VRes: integer;
  82.                         Number indicating the vertical resolution of the
  83.                         device that created the picture file.
  84.                   CMap: TripletArray;
  85.                         2-dimensional array ( 16 triplets ) containing palette
  86.                         information for the following picture. If the
  87.                         following image is color and the displaying device
  88.                         is an EGA/VGA, the color map is used and the palette
  89.                         is set accordingly, if requested in the Show method.
  90.                         Otherwise CMap is ignored.
  91.                   Reserved: byte;
  92.                         Filler number reserved by ZSoft.
  93.                   NPlanes: byte;
  94.                         Number of picture planes used to create the image.
  95.                         Essentially establishes the differance between a mono
  96.                         and color picture.
  97.                         See: BasePCX.IsMultiPlane
  98.                   NBpl: integer;
  99.                         Number telling the object how many bytes are used to
  100.                         store a single horizontal line of the picture in
  101.                         memory.
  102.                   Palett: integer;
  103.                         Number for interpreting the palette. 0 = gray scale
  104.                         iamge. 1 = color image.
  105.  
  106. Page        Page: byte;                                           Read only
  107.  
  108.             Used when reading PCX files, it determines which video page the
  109.             image is written to. Since the object uses direct memory, the
  110.             picture is written to the page requested regardless of the
  111.             active page setting. The visual page setting still maintains
  112.             display control.
  113.  
  114. PFile       PFile: pointer;                                       Read only
  115.  
  116.             Points to dynamic memory area where entire PCX file has been
  117.             read into ram. This increases decoding speed by reading the
  118.             compressed image data from ram instead of thru file I/O.
  119.             PCXError will be set if there is not enough memory available.
  120.             See: BasePCX.Done
  121.  
  122. SizeF       SizeF: longint;                                       Read only
  123.  
  124.             Size of PCX file read into ram. Used for disposing memory when
  125.             destructing the object.
  126.  
  127. Buf         Buf: PBuf;                                            Read only
  128.  
  129.             Pointer to  dynamic variable (128 byte) which holds one complete
  130.             decoded/encoded scan line during the decoding or encoding
  131.             method.
  132.  
  133. Offset      Offset: POffset;                                      Read only
  134.  
  135.             One-dimensional 480 byte array holding the video memory offset
  136.             address to the beginning of each horizontal scan line. The
  137.             offsets are calculated based on the object and not the creating
  138.             device.
  139.  
  140. Display     Display: DisplayRec;                                  Read/Write
  141.  
  142.             Record variable set by descendant objects upon initialization
  143.             containing display adapter information. Correct information is
  144.             set based on the descendant type and not the creating device.
  145.             The record contains the following fields:
  146.  
  147.                   SegBase: word;
  148.                         Base address to video memory.
  149.                   Page0: word;
  150.                         Offset from SegBase for start of video page 0.
  151.                   Page1: word;
  152.                         Offset from SegBase for start of video page 1.
  153.                   HorizRes: integer;
  154.                         Horizontal resolution of specific adapter.
  155.                         Informative only, not used.
  156.                   VertRes: integer;
  157.                         Vertical resolution of specific adapter.
  158.                         Informative only, not used.
  159.                   BytesPerLine: integer;
  160.                         Num